otutil: New utility functions
authorColin Walters <walters@verbum.org>
Tue, 29 Nov 2011 18:42:05 +0000 (13:42 -0500)
committerColin Walters <walters@verbum.org>
Tue, 29 Nov 2011 18:42:05 +0000 (13:42 -0500)
src/libotutil/otutil.h

index a93dc84dd5259d2999d08bbb321e23bb5f70af4b..a48408f58b9b0e1eb0397a68351eb75d867cce9c 100644 (file)
 
 #ifndef __OSTREE_UTIL_H__
 
+#define ot_gobject_refz(o) (o ? g_object_ref (o) : o)
+#define ot_clear_checksum(c) G_STMT_START {     \
+  typeof(c) __tmp_chksum = c;                   \
+  if (__tmp_chksum)                             \
+    {                                           \
+      g_checksum_free (*__tmp_chksum);          \
+      *__tmp_chksum = NULL;                     \
+    }                                           \
+  } G_STMT_END;
+
 #include <ot-gio-utils.h>
 #include <ot-glib-compat.h>
 #include <ot-opt-utils.h>